<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<div class="row-fluid">
	<div class="span6">
		
	</div>
	<div class="span6">
		
		<div class="dataTables_paginate paging_bootstrap pagination">
			<ul>
				<li  class="prev">共 ${map.pageSize }页  ${map.count} 条记录</li>
				<c:choose>
					<c:when test="${map.pageIndex == 1 }">
						<li class="prev disabled">
							<a href="${action }?pageIndex=${map.pageIndex - 1 }&&id=${map.objectList[0].tagList[0].id}">← <span class="hidden-480">上一页</span></a>
						</li>
					</c:when>
					<c:otherwise>
						<li class="prev">
							<a href="${action }?pageIndex=${map.pageIndex - 1 }&&id=${map.objectList[0].tagList[0].id}">← <span class="hidden-480">上一页</span></a>
						</li>
					</c:otherwise>
				</c:choose>
				
				<c:choose>
					<c:when test="${map.pageSize <= 8 }">
						<c:forEach begin="1" end="${map.pageSize }" var="i">												
							<c:choose>
								<c:when test="${i == map.pageIndex }">
									<li class="active">
										<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
									</li>
								</c:when>
								<c:otherwise>
									<li class="">
										<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
									</li>
								</c:otherwise>
							</c:choose>													
						</c:forEach>
					</c:when>

					<c:otherwise>
					  <c:choose>
							<c:when test="${map.pageIndex<=5 }">
								<c:forEach begin="1" end="8" var="i">												
									<c:choose>
										<c:when test="${i == map.pageIndex }">
											<li class="active">
												<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
											</li>
										</c:when>
										<c:otherwise>
											<li class="">
												<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
											</li>
										</c:otherwise>
									</c:choose>													
								</c:forEach>
							</c:when>

							<c:when test="${map.pageIndex>5 && map.pageIndex<=pageSize-3 }">
								<c:forEach begin="${map.pageIndex-4}" end="${map.pageIndex+3}" var="i">												
									<c:choose>
										<c:when test="${i == map.pageIndex }">
											<li class="active">
												<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
											</li>
										</c:when>
										<c:otherwise>
											<li class="">
												<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
											</li>
										</c:otherwise>
									</c:choose>													
								</c:forEach>
							</c:when>
							
							<c:otherwise>
								<c:forEach begin="${map.pageSize-7}" end="${map.pageSize }" var="i">												
									<c:choose>
										<c:when test="${i == map.pageIndex }">
											<li class="active">
												<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
											</li>
										</c:when>
										<c:otherwise>
											<li class="">
												<a href="${action }?pageIndex=${i }&&id=${map.objectList[0].tagList[0].id}">${i }</a>
											</li>
										</c:otherwise>
									</c:choose>													
								</c:forEach>
							</c:otherwise>
						</c:choose>
					</c:otherwise>				
				</c:choose>																		
				<c:choose>
					<c:when test="${map.pageIndex == map.pageSize }">
						<li class="next disabled">
							<a href="${action }?pageIndex=${map.pageIndex + 1 }&&id=${map.objectList[0].tagList[0].id}"><span class="hidden-480">下一页</span> → </a>
						</li>
					</c:when>
					<c:otherwise>
						<li class="next">
							<a href="${action }?pageIndex=${map.pageIndex + 1 }&&id=${map.objectList[0].tagList[0].id}"><span class="hidden-480">下一页</span> → </a>
						</li>
					</c:otherwise>
				</c:choose>																															
			</ul>
		</div>
	</div>
</div>